<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button id="saveBtn">save</button>
    <script>
        const saveBtn = document.getElementById('saveBtn');


        saveBtn.addEventListener('say', () => {
            console.log(1);
        });
        saveBtn.addEventListener('say', () => {
            console.log(2);
        });
        saveBtn.addEventListener('say', () => {
            console.log(3);
        });
        // 事件名称语义化
        saveBtn.onclick = function () {
            saveBtn.dispatchEvent(new CustomEvent('say', { detail: { a: 1 } }));
        }


    </script>

</body>

</html>